// --------------------------------------------------------------------------------------------------------------------
// <copyright file="WorkItemMetadataAttribute.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   Work metadata attribute that is used to put metadata compatible with <see cref="IWorkItem" />
//   on an implementation of <see cref="IWorkItemMetadata" />. <seealso cref="IWorkItemMetadata" />.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.ComponentModel.Composition;

namespace AzureContrib.WindowsAzure.WorkServices
{
	/// <summary>
	/// Work metadata attribute that is used to put metadata compatible with <see cref="IWorkItem"/>
	/// on an implementation of <see cref="IWorkItemMetadata"/>. <seealso cref="IWorkItemMetadata"/>.
	/// </summary>
	[MetadataAttribute,
	 AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
	public sealed class WorkItemMetadataAttribute : ExportAttribute
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="WorkItemMetadataAttribute"/> class. 
		/// Constructs new metadata for an <see cref="IWorkItem"/> compatible with <see cref="IWorkItemMetadata"/>
		/// </summary>
		/// <param name="order">The simple standard ordering or <see cref="IWorkItem"/>s.</param>
		/// <param name="workType">The <see cref="WorkType"/>. </param>
		/// <param name="name">The name of the work.</param>
		/// <param name="description">The description for this work.</param>
		public WorkItemMetadataAttribute(int order, WorkType workType, string name, string description)
			: base(typeof(IWorkItem))
		{
			Order = order;
			WorkType = workType;
			Name = name;
			Description = description;
		}

		/// <summary>
		/// Gets the <see cref="IWorkItemMetadata.Order"/>.
		/// </summary>
		public int Order { get; private set; }

		/// <summary>
		/// Gets the <see cref="IWorkItemMetadata.WorkType"/>.
		/// </summary>
		public WorkType WorkType { get; private set; }

		/// <summary>
		/// Gets the <see cref="IWorkItemMetadata.Name"/>.
		/// </summary>
		public string Name { get; private set; }

		/// <summary>
		/// Gets the <see cref="IWorkItemMetadata.Description"/>.
		/// </summary>
		public string Description { get; private set; }
	}
}